import axios from 'axios'
const base = 'http://localhost:8080/' //本地服务地址

axios.defaults.timeout = 10000;

let api = {
    playlist:`${base}playlist/list`,
    getById:`${base}playlist/getById`,
    updatePlaylist:`${base}playlist/updatePlaylist`,
    del:`${base}playlist/del`,
    delPic:`${base}swiper/del`,
    getPicList:`${base}swiper/list`,
    getBlogList:`${base}blog/list`,
    delBlog:`${base}blog/del`,
}

export function getPlayList(params) {
    return axios({
        method:'get',
        url:api.playlist,
        params
    })
}

export function getById(params) {
    return axios({
        method:'get',
        url:api.getById,
        params
    })
}

export function update(params) {
    return axios({
        method:'post',
        url:api.updatePlaylist,
        data:{
            ...params
        }
    })
}

export function del(params) {
    return axios({
        method:'get',
        url:api.del,
        params
    }) 
}

export function getPicList(params) {
    return axios({
        method:'get',
        url:api.getPicList
    }) 
}

export function delPic(params) {
    return axios({
        method:'get',
        url:api.delPic,
        params
    }) 
}

export function blogList(params) {
    return axios({
        method:'get',
        url:api.getBlogList,
        params
    })
}

export function delBlog(params) {
    return axios({
        method:'post',
        url:api.delBlog,
        data:{
            ...params
        }
    }) 
}

